<template>
	<div>
		<el-card shadow="never">
			<el-table v-loading="loading" :data="tableData" style="width: 100%;margin-top: 20px">
				<el-table-column type="index" width="50"></el-table-column>
				<el-table-column label="签约类型" align="center"  prop="dicType">
					<template slot-scope="scope">
						<span v-if="scope.row.dicType == 1">点数相关</span>
						<span v-if="scope.row.dicType == 2">用户标签相关</span>
					</template>
				</el-table-column>
				<el-table-column label="值" align="center"  prop="dicValue"></el-table-column>
				<el-table-column label="说明" align="center"  prop="dicTitle"></el-table-column>
				<el-table-column label="状态" align="center"  prop="dicStatus">
					<template slot-scope="scope">
						<span v-if="scope.row.dicStatus == 0">禁用</span>
						<span v-if="scope.row.dicStatus == 1">启用</span>
						<span v-if="scope.row.dicStatus == 2">删除</span>
					</template>
				</el-table-column>
				<el-table-column label="创建时间" align="center" prop="createTime"></el-table-column>
			</el-table>
			<!-- <div style="margin-top: 20px;text-align: right">
				<el-pagination background @current-change="columnFind" :current-page="page.page" :page-size="page.pagesize" layout="prev, pager, next, jumper, total"
				 :total="page.count"></el-pagination>
			</div> -->
			<div style="margin-top: 20px;text-align: right">
				<el-pagination background @current-change="columnFind" :current-page="page.page" :page-size="page.pagesize" layout="prev, pager, next, jumper, total"
				 :total="page.count"></el-pagination>
			</div>
		</el-card>
	</div>
</template>

<script>
	import {
		dictionaryList
	} from '../../../server/index.js';
	import Cookie from 'js-cookie';
	export default {
		data() {
			return {
				tableData: [],
				page: {
					count: 0,
					pagesize: 10,
					page: 1
				},
				loading: true
			};
		},
		mounted() {
			var page = 1;
			this.columnFind(page);
			Cookie.remove('tabList');
		},
		methods: {
			columnFind(page) {
				const _this = this;
				_this.page.page = page;
				let obj = {
					page: _this.page.page,
					rows: _this.page.pagesize,
				};
				_this.http.request({
					url: dictionaryList,
					data: obj,
					success: function(res) {
						_this.loading = false;
						_this.tableData = res.list;
						_this.page.count = res.total;
					},
					error: function(err) {
						_this.$message({
							offset: '200',
							message: err.msg
						})
					}
				});
			}
		}
	};
</script>

<style></style>
